data<-read.table("GE.txt",sep="\t",head=T,nrow=1)
colnames_gene<-colnames(data)
colnames_gene[1:5]
data<-read.table("GE_allsamples.txt",sep="\t",head=T,nrow=1)
colnames_gene<-colnames(data)
colnames_gene[1:5]
colnames_gene<-gsub("\\.","-",colnames_gene)
colnames_gene[1:5]
colnames_gene1<-colnames_gene
i<-2
while(i<length(colnames_gene)+1)
{ colnames_gene[i]<-paste(unlist(strsplit(colnames_gene[i], "-"))[1:3],collapse='-')
i<-i+1
}
length(colnames_gene)
length(colnames_gene1)
length(which(!duplicated(colnames_gene))
)
batch<-c()
batch<-cbind(colnames_gene[which(!duplicated(colnames_gene))],colnames_gene1[which(!duplicated(colnames_gene))])
dim(batch)
batch[1:5,]
data<-read.table("GE.txt",sep="\t",head=T,nrow=1)
rownames(batch)<- as.character(batch[,1])
rownames(batch)[1:5]
batch1<-batch[colnames(data),]
length(colnames(data))
dim(batch)
colnames(data)[1:5]
colnames(data)<-gsub("\\.","-",colnames(data))
colnames(data)[1:5]
batch1<-batch[colnames(data),]
dim(batch1)
write.table(batch1,"geneexpr_batch_info.txt",sep="\t",quote=F,col.names=F,row.names=F)
getwd()
savehistory('batch.R"0
savehistory('batch.R")
savehistory("batch.R")
